<template>
  <div class="container" ref="site">
    <div class="site">
      <div class="liubai"></div>
      <div class="site-header">
        <span class="back" @click="back"></span>
        <span class="header">地址管理</span>
      </div>
      <div class="site-center"></div>
      <div class="site-sole" @click="sites">
        <span> + <span>新建地址</span></span>
      </div>
    </div>
  </div>
</template>

<script>
import BScroll from 'better-scroll'
export default {
  name: 'site',
  methods: {
    back () {
      this.$router.push({path: '/home'})
    },
    sites () {
      this.$router.push({path: '/newSite'})
    }
  },
  mounted () {
    this.$nextTick(() => {
      let site = this.$refs.site
      let scroll = new BScroll(site, {
        click: true,
        scrollY: true,
        bounce: false
      })
      return scroll
    })
  }
}
</script>

<style scoped lang="scss">
  .container {
    width: 100vw;
    height: 100vh;
    .site{
      width: 100vw;
      height: 100vh;
      .liubai{
        height: 60px;
        background: #fff;
      }
      .site-header{
        height: 130px;
        background: #fff;
        display: flex;
        justify-content: center;
        position: relative;
        border-bottom: solid 4px #dcdcdc;
        .back{
          width: 50px;
          height: 50px;
          border: solid 1px;
          position: absolute;
          left: 60px;
          top: 5px;
          transform: rotate(45deg);
          border-top: none;
          border-right: none;
        }
        .header{
          font-size: 50px;
        }
      }
      .site-center{
        width: 280px;
        height: 280px;
        background: url("./icons/noAddress-c73987af41.png") no-repeat;
        background-size: 100% 100%;
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        top: 0;
        margin: auto;
      }
      .site-sole{
        width: 1140px;
        height: 160px;
        background: #ec6b58;
        position: fixed;
        bottom: 52px;
        left: 52px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 50px;
        color: #fff;
      }
    }
  }
</style>
